import os
def visit(arg,dirname,names):
    print 'dirname = ', dirname
    print 'arg = ', arg
    print 'names = ',names
    files = []
    for name in names:
        subname = os.path.join(dirname, name)
        if os.path.isfile(subname):
            pass
        else:
            print 'dir = ', name
os.path.walk('D:\\test', visit, '(data)')
